home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-15 | 9.9 KB | 324 lines | [TEXT/MPS ] |
- ;_________________________________________________________________________________
- ;
- ; File: adev.a
- ;
- ; Apple Computer, Inc.
- ; Copyright (C) 1992,1993. All rights reserved.
- ;
- ; This file contains main entry code for the XTI Shell adev. A jump table is
- ; used to determine which call is being made, and a C routine is called (in
- ; most cases) to execute the command.
- ;
- ; Revision History:
- ;
- ;__________________________________________________________________________________
- BLANKS ON
-
- TITLE 'XTI adev interface routines'
-
- PRINT PUSH,OFF
- INCLUDE 'SysEqu.a' ; System definitions
- INCLUDE 'HardwareEqu.a' ; some hardware stuff
- INCLUDE 'SysErr.a' ; System errors
- INCLUDE 'Private.a' ; System private definitions
- INCLUDE 'ToolEqu.a' ; Toolbox definitions
- INCLUDE 'Traps.a' ; Traps definitions
- INCLUDE 'AtalkEqu.a' ; Appletalk defs
- PRINT POP
- INCLUDE 'LAPEqu.a' ; LAP manager defs
-
-
- IMPORT (MGetADEV, MAGetAttribs, MAInit, MAKill):CODE
- IMPORT (MADraw, MAClick, MAKey):CODE
- IMPORT (MAActivate, MASelectTE, MAIdle, MAMessage):CODE
- IMPORT (MAGetConfig, MAGetLine):CODE
- EXPORT (ADEVCONTROL):CODE
-
- GetLine EQU $75
-
- ResInfo RECORD 0,DECREMENT ; parms for GetResInfo call
- theID DS.W 1
- theType DS.L 1
- theName DS.B 256
- Size DS.B 0
- ENDR
-
- ADEVCONTROL PROC ; D0 = control code
- CMP #GetADEV,D0 ; compare to lowest command
- BLT.S ExitCntrl ; Return error if too low
-
- CMP #GetLine,D0 ; Make sure not too high
- BGT.S ExitCntrl ; Br if too high
- @ProcReq
- SUB #GetADEV, D0 ; subtract base from control code
- ADD.W D0,D0 ; D0 = D0 * 2;
- MOVE.W @ControlTable(D0.W),D0 ; Get the routine offset
- JMP @ControlTable(D0.W) ; Process the request
-
- @ControlTable
- DC.W DoGetADEV-@ControlTable ; get next adev
- DC.W DoSelectADEV-@ControlTable ; select adev
- DC.W DoSelectADEV-@ControlTable ; re-sel adev
- DC.W DoMGetADEV-@ControlTable ; method-based get adev
- DC.W ExitCntrl-@ControlTable ; nothing defined
- DC.W DoGetAttr-@ControlTable ; get attributes
- DC.W DoInitADEV-@ControlTable ; init
- DC.W DoKillADEV-@ControlTable ; kill
- DC.W DoActADEV-@ControlTable ; do act/inactivate
- DC.W DoClickADEV-@ControlTable ; click
- DC.W DoDrawADEV-@ControlTable ; draw
- DC.W DoMsgADEV-@ControlTable ; message
- DC.W DoIdleADEV-@ControlTable ; idle
- DC.W DoKeyADEV-@ControlTable ; key
- DC.W DoSelTE-@ControlTable ; selectTE
- DC.W DoGetConfig-@ControlTable ; get config
- DC.W DoGetLine-@ControlTable ; get a summary line
- ExitCntrl
- RTS
-
-
- ;________________________________________________
- ; GetADEV
- ;
- ; This call is made by the Network CDEV to all
- ; adevs. Since we don't want to be included in
- ; the control panel because we are not an
- ; AppleTalk adev, just return an error.
- ;
- ; Call: D1(long) = current value of parameter RAM (3 bytes)
- ; D2(long) = value returned from prev GetADEV or ZERO
- ;
- ; Return: D0(byte) = status flag
- ; D2(long) = value to use for subsequent
- ; call (if any) or SelectADEV call
- ; A0->string to describe ICN#(adevBaseID)
- ;________________________________________________
-
- DoGetADEV
- MOVEQ #1,D0 ; no more AppleTalks supported
- CLR.L D2 ; illegal value
- LEA NAstr,A0 ; A0->"N/A"
- RTS ; return with error
-
-
- NAstr DC.B 3,'N/A'
- ALIGN 2
-
- ;________________________________________________
- ; SelectADEV
- ;
- ; This routine is called by the Network CDEV
- ; when the adev is selected in the control
- ; panel. It should NEVER be called, so just
- ; return.
- ;
- ; Call: D2(long) = value returned by GetADEV
- ;
- ; Return: D1(high 3 bytes) = value to set in
- ; parameter RAM & call ATLK with
- ;________________________________________________
-
- DoSelectADEV
- RTS
-
- ;________________________________________________
- ; DoMGetADEV
- ;
- ; Call: A0(long) = pointer to ADev record, provided by caller
- ;
- ; Return: A0(long) = ADevRec pointer
- ; D0(byte) = status: 0 for noErr, 1 for no
- ; more information, -1 for fatal error
- ;________________________________________________
-
- DoMGetADEV
- MOVE.L A0, -(SP) ; move adevRec onto stack
- JSR MGetADEV ; returns status in D0
- MOVE.L (SP)+, A0 ; restore aRecPtr to A0
- RTS
-
-
- ;________________________________________________
- ; DoGetAttr
- ;
- ; Call: A0(long) = pointer to ADev Window record,
- ; provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for
- ; insufficient drawing height
- ;________________________________________________
-
- DoGetAttr
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAGetAttribs ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
- ;________________________________________________
- ; DoInitADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for
- ; initialization err
- ;________________________________________________
-
- DoInitADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAInit ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoKillADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for
- ; can't close at this time
- ;________________________________________________
-
- DoKillADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAKill ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
- ;________________________________________________
- ; DoActADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
- DoActADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAActivate ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoClickADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
-
- DoClickADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAClick ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoDrawADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
- DoDrawADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MADraw ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
- ;________________________________________________
- ; DoMsgADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
- DoMsgADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAMessage ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoIdleADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
- DoIdleADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAIdle ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoKeyADEV
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for fatal err
- ;________________________________________________
-
- DoKeyADEV
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAKey ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoSelTE
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for cannot deactiv current TE field
- ;________________________________________________
-
- DoSelTE
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MASelectTE ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ;________________________________________________
- ; DoGetConfig
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for invalid config field data
- ;________________________________________________
-
- DoGetConfig
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAGetConfig ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
- ;________________________________________________
- ; DoGetLine
- ;
- ; Call: A0(long) = pointer to ADev Window record, provided by caller
- ;
- ; Return: A0(long) = ADevWind pointer
- ; D0(byte) = status: 0 for noErr, -1 for no more lines
- ;________________________________________________
-
- DoGetLine
- MOVE.L A0, -(SP) ; move TAdevWindPtr onto stack
- JSR MAGetLine ; returns status in D0
- MOVE.L (SP)+, A0 ; clean up the stack & restore A0
- RTS
-
- ENDPROC
- END
-